[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  Function            diffddate - calculate the difference in 2 dates

  Syntax              long int diffddate(struct ddate *start,
                                          struct ddate *fini);

  Prototype in        datehk.h

  Remarks             diffddate calculates the difference in days between
                      start and fini (fini - start).

                      diffddate does not perform any error checking on the
                      passed parameters.

  Return value        returns the number of days from start to fini.

  See also            dayofyear(), daysleft(), diffddate()

  Example             #include <datehk.h>

                      main()
                      {
                           struct ddate begin, end;
                           long int days;

                           /* set begin to Jan 1, 1981 */
                           /* set end to Feb 5, 1982 */
                           days = diffddate(&begin,&end);
                           printf("Feb 5, 1982 - Jan 1, 1981 =
                                %ld\n",days);
                      }

  Program output      Feb 5, 1982 - Jan 1, 1981 = 400


See Also: dayofyear() daysleft()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson